package com.woniu.common.exception;

import com.woniu.common.enums.ExceptionCode;

public class CustomException extends RuntimeException{

    public CustomException(ExceptionCode exceptionCode){
        this.code=exceptionCode.getCode();
        this.msg=exceptionCode.getMsg();
    }

    public CustomException(String errorMsg){
        this.code= 500;
        this.msg=errorMsg;
    }

    private Integer code;
    private String msg;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
